#pragma once
#include "Light.h"
#include "Sphere.h"
#include <vector>
using namespace std;



class Scene
{
private:
	vector<Light*> m_lights;
    vector<RenderableObject*> m_objects;

    ColorValue     m_colorAmbient; // the ambient color

public:	
    Scene(void);
    virtual ~Scene(void);

    void Init();

    ColorValue GetAmbientColor()
    {
        return m_colorAmbient;
    }

    // simple test for retrieve a sphere's info
    int GetObjectNum()
    {
        return m_objects.size();
    }

    // Get RenderableObject
    RenderableObject* GetObject(int index)
    {
        if( index < 0 || index >= (int)m_objects.size())
            return NULL;

        return m_objects[index];
    }

    vector<Light*>& GetLights(void);

    // Find the nearest object which intersected by the line.
    bool Intersect(Line *pLine, IntersectInfo* pInfo);

    // Just test if any object intersect the line.
    // If intersect, this function return true immediately.
    // This funcion don't care the distance from the object.
    bool SegmentIntersect(Line *pLine);
};

